// import Home from "../views/Home";
// import Login from "../views/Login";
// import Register from "../views/Register";
// import Search from "../views/Search";
// import Detail from "../views/Detail";

// 定义路由表
export default [
  { path: "/", redirect: "/home" },
  {
    path: "/home",
    name: "home",
    component: () => import("../views/Home"),
    meta: {
      isShowSort: true,
    },
  },
  {
    path: "/search/:keyword?",
    name: "search",
    component: () => import("../views/Search"),
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/Login"),
    meta: { isShowFooter: true }, //配置路由元
  },
  {
    path: "/register",
    name: "register",
    component: () => import("../views/Register"),
    meta: { isShowFooter: true },
  },
  {
    path: "/detail/:id?",
    name: "detail",
    // component: Detail,
    component: () => import("../views/Detail"), //路由懒加载
    props: true, //确认将路由中的props传到对应路由中，用props接收
  },
  {
    path: "/addcartsuccess",
    name: "addCartSuccess",
    component: () => import("../views/AddCartSuccess"),
  },
  {
    path: "/shopcart",
    name: "shopCart",
    component: () => import("../views/ShopCart"),
  },
  {
    path: "/trade",
    name: "trade",
    component: () => import("../views/Trade"),
  },
  {
    path: "/pay",
    name: "pay",
    component: () => import("../views/Pay"),
  },
  {
    path: "/paysuccess",
    name: "PaySuccess",
    component: () => import("../views/PaySuccess"),
  },
  {
    path: "/center",
    name: "center",
    component: () => import("../views/Center"),
  },
];
